package com.wxzz.elearing.evaluation.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wxzz.elearing.evaluation.entity.BusinessCategory;
import com.wxzz.elearing.evaluation.entity.Topic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 存放草稿箱
 */
@Data
@Document(collection = "wxzz-topic")
@ApiModel(value = "TopicMongoDto对象", description = "草稿箱")
public class TopicMongoDto implements Serializable {

    @Id
    private String uid;

    @ApiModelProperty(value = "测试用户id")
    @Field("wxUserId")
    private Long wxUserId;

    @NotNull(message = "请传入type 0-工厂体检 1-星级认证 2-能力测评")
    @ApiModelProperty(value = "0-工厂体检 1-星级认证 2-能力测评")
    @Field("type")
    private Integer type;

    @ApiModelProperty(value = "体检/星级/测评id")
    @Field("commonId")
    private Long commonId;

    @ApiModelProperty(value = "分组")
    private List<BusinessCategory> businessCategorys;

    @ApiModelProperty(value = "做到第几题")
    @Field("index")
    private Integer index;

    @ApiModelProperty(value = "工厂体检id")
    @Field("businessCategoryRuleId")
    private Long businessCategoryRuleId;

    @ApiModelProperty(value = "题目列表")
    @Field("topicList")
    private List<Topic> topicList;

    @ApiModelProperty(value = "保存时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field("createTime")
    private LocalDateTime createTime;
}
